#!/usr/bin/python

import random

if __name__ == "__main__":
    size = 100
    users = []
    mobi = ['130', '133', '134', '135',
            '136', '137', '138', '139',
            '150', '151', '153', '158',
            '159', '170', '180', '181',
            '183', '185', '186', '187',
            '188', '189'
            ]
    for i in range(size):
        user = {}
        user["id"] = i + 1
        t = random.randint(0, len(mobi) - 1 )
        m = mobi[t]
        s = random.randint(10000000, 90000000)
        mobile = m + str(s)
        user["mobile"] = mobile
        user["name"] = "test" + str(i)
        tt = random.randint(1000, 10000)
        user["monthIncome"] = tt
        user["address"] = "testadd" + str(s)
        users.append(user)
    # print users
    fout = open("input_data.txt", "w")
    for user in users:
        fout.write(str(user['id'])+"\t")
        fout.write(user['mobile'] + "\t")
        fout.write(user['name'] + "\t")
        fout.write(str(user['monthIncome']) + "\t")
        fout.write(user['address'] + "\t")
        fout.write("\n")
    fout.close()
    print "success"


